<?php

namespace app\admin\validate;

use think\Validate;

class Resource extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
		'industry' => 'require',
        'category' => 'require',
        'content' => 'require|unique:resource'
    ];

    /**
     * 字段描述
     */
    protected $field = [
    ];
    /**
     * 提示消息
     */
    protected $message = [
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['industry', 'category', 'content'],
        'edit' => ['industry', 'category', 'content'],
    ];

    public function __construct(array $rules = [], $message = [], $field = [])
    {
        $this->field = [
			'industry' => __('行业'),
            'category' => __('类别'),
            'content' => __('内容')
        ];
        parent::__construct($rules, $message, $field);
    }

}
